Many modern operating systems utilize threads as the basic unit of execution. Each thread in a process is associated with a sequence of CPU instructions, a set of CPU registers and a stack.
The operating system is responsible for scheduling threads. Different operating systems perform thread scheduling and thread synchronization in different manners. Thus, application programs are designed to utilize the thread scheduling protocols of the operating system. If the application is to be run on a different operating system care must be taken to account for different thread management protocols.
In some cases special software may be written to port applications to another operating system. The porting application presents a consistent set of application program interfaces (APIs) application programs and includes functions to generate instructions to cause the new operating system to transparently provide the support expected by the application programs written for the original operating system.